/// 抽象类
public abstract class Strategy{
    public abstract void AlgorithmInterface();
}

/// 实现类A
public class ConcreteStrategyA:Strategy{
    public override void AlgorithmInterface()
    {
        Console.WriteLine("Called ConcreteStrategyA.AlgorithmInterface()");
    }
}

///实现类B
public class ConcreteStrategyB : Strategy
{
    public override void AlgorithmInterface()
    {
                Console.WriteLine("Called ConcreteStrategyB.AlgorithmInterface()");
    }
}

///实现类C
public class ConcreteStrategyC : Strategy
{
    public override void AlgorithmInterface()
    {
                Console.WriteLine("Called ConcreteStrategyC.AlgorithmInterface()");
    }
}
///上下文,使用策略模式
public class Context{
     Strategy strategy;

     public Context(Strategy strategy){
        this.strategy=strategy;
     }
     public void ContextInterface(){
        strategy.AlgorithmInterface();
     }
}